package com.design.classroommanagement.admin

import com.design.classroommanagement.Pages
import com.design.classroommanagement.api.Role
import com.design.classroommanagement.api.dao.BookmarkDao
import com.design.classroommanagement.databinding.ActivityAdminHomepageBinding
import com.laughing.lib.base.HBaseFragment
import com.laughing.lib.base.HBaseViewModel
import com.laughing.lib.base.getVm
import com.laughing.lib.utils.clickWithTrigger
import com.laughing.lib.utils.openPage
import com.laughing.lib.utils.runInBg

class AdminHomeFragment : HBaseFragment<HBaseViewModel, ActivityAdminHomepageBinding>() {
    override fun initCompleted() {
        binding.apply {
            teacherBtn.clickWithTrigger {
                openPage(Pages.TEACHER_LIST) {
                    withSerializable("role", Role.teacher)
                }
            }

            studentBtn.clickWithTrigger {
                openPage(Pages.TEACHER_LIST) {
                    withSerializable("role", Role.student)
                }
            }

            classBtn.clickWithTrigger {
                runInBg {
                    openPage(Pages.BookmarkListFragment)
                }
            }
        }
    }
}